package com.ease.web.xwt.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author nathanleewei
 * 
 */
public class XOption implements Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 3974436161525012880L;

	private String text;

	private String value;

	public XOption() {

	}

	public XOption(String text, String value) {
		setText(text);
		setValue(value);
	}

	public static List<XOption> toOptions(List<String> texts, List<String> values) {
		List<XOption> options = null;

		if ((null != texts) && (null != values)) {
			options = new ArrayList<XOption>();

			for (int i = 0; i < texts.size(); i++) {
				options.add(new XOption(texts.get(i), values.get(i)));
			}
		}

		return options;
	}

	/**
	 * @return Returns the text.
	 */
	public String getText() {
		return text;
	}

	/**
	 * @param text
	 *            The text to set.
	 */
	public void setText(String text) {
		this.text = text;
	}

	/**
	 * @return Returns the value.
	 */
	public String getValue() {
		return value;
	}

	/**
	 * @param value
	 *            The value to set.
	 */
	public void setValue(String value) {
		this.value = value;
	}

}
